package com.example.im.bean.converters

import androidx.room.TypeConverter
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken

class AitsConverters {
    @TypeConverter
    fun stringToObject(value: String?): Set<String>? {
        val listType = object : TypeToken<Set<String>>() {

        }.type
        return Gson().fromJson(value, listType)
    }

    @TypeConverter
    fun objectToString(list: Set<String>?): String? {
        val gson = Gson()
        return gson.toJson(list)
    }
}